<template>
	<view class="main">
		<header-vue title="接单大厅" titPosition="left" bgColor="transparent" titleColor="#222222"  :back="true"></header-vue>
			<view class="flex between order-type select-box font30 position-relative">
				<view class="item" v-for="(item, index) in orderType" :class="{active: orderIndex == index}" @click="changeprderType(index)">{{item}}</view>
				<view class="flex filter-btn" @click="showFilter = true">
					
					<i class="iconfont icon-loudou font28"></i>
					<view>筛选</view>
				</view>
			</view>
		<scroll-view v-show="orderIndex == 0" scroll-y class="content-top">
			<view class="pt-28rpx pb-40rpx px-30rpx">
			<view class="swiper-box">
				<view class="flex between mb-28rpx">
					<view class="swiper-title font30">母婴服务 </view>
					
					<view class="swiper-state font24">
						<!-- <view class="price flex">
							<view class="flex" v-if="item.positive_rate && item.positive_rate.toString().includes('.')">
								<view class="font24">￥</view>
								<view class="font32">{{ item.positive_rate.toString().split('.')[0] }}</view>
								<view class="font20">.{{ item.positive_rate.toString().split('.')[1] }}</view>
							</view>
							<view class="flex" v-else>
								<view class="font24">￥</view>
								<view class="font32">{{ item.positive_rate }}</view>
								<view class="font24">.00</view>
							</view>
							<view class="time font20">/{{ item.price_unit }}</view>
						</view> -->
						<view class="price flex">
						
							<view class="flex" >
								<view class="font24">￥</view>
								<view class="font32">90</view>
								<view class="font24">.00</view>
							</view>
							
						</view>
					
					</view>
				</view>
				<view class="flex start">
					<view class="item-icon"><image :src="IMAGE_URL + '/static/images/address-icon.png'"></image></view>
					<view class="font24 swiper-des">上门地址：华望城社区物业中心</view>
				</view> 
				<view class="flex start ">
					<view class="item-icon"><image :src="IMAGE_URL+ '/static/images/order-service-icon.png'"></image></view>
					<view class="font24 swiper-des">服务内容：精选日常保洁2小时</view>
				</view> 
				<view class="flex start ">
					<view class="item-icon"><image :src="IMAGE_URL + '/static/images/home-watch-icon.png'"></image></view>
					<view class="font24 swiper-des">预约时间：2025-06-03 10:53</view>
				</view> 
				
				
				<view class="order-btn">接单</view>
			</view>
			</view>
		</scroll-view>
		<scroll-view v-show="orderIndex == 1" scroll-y class="content-top">
			
		</scroll-view>
		<scroll-view v-show="orderIndex == 2" scroll-y class="content-top">
			
		</scroll-view>
		<scroll-view v-show="orderIndex == 3" scroll-y class="content-top">
			
		</scroll-view>
		<u-popup :show="showFilter" mode="bottom" @close="showFilter = false" :round="28">
			<view class="flex modal-title">
				<view class="flex font36 fontbold-500">全部筛选</view>
				<i class="iconfont icon-close font32" @click="showFilter = false"></i>
			</view>
			<view class="modal-content margin32">
				<view class="sub-titile font30 fontbold-500">价格区间</view>
				<view class="flex start checkbox-box">
					<view class="flex column checkbox" v-for="item in priceBetween" :key="item.name" :class="{active: item.name === params.price }">
						<view class="font28">{{item.name}}</view>
						<view class="font24">{{item.des}}</view>
					</view>
				</view>
				<view class="flex between input-group">
					<input placeholder="自定义最低价"/>
					<view class="line"></view>
					<input placeholder="自定义最高价"/>
				</view>
				<view class="sub-titile font30 fontbold-500">品牌</view>
				<view class="flex start checkbox-box">
					<view class="flex column checkbox" v-for="item in priceBetween" :key="item.name" :class="{active: item.name === params.price }">
						<view class="font28">{{item.name}}</view>
						<view class="font24">{{item.des}}</view>
					</view>
				</view>
			</view>
			<view class="flex modal-footer font36 fontbold-500">
				<view class="flex clear-btn" @click="showFilter = false">清空选择</view>
				<view class="flex submit-btn" @click="showFilter = false">确定</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	import headerVue from '../../../components/header.vue';
	import appConfig from '@/config/app.js'
	import {getorderliststatus, getorderlist} from  '@/api/modules/shop.js'
	export default {
		components: {
			headerVue
		},
		data() {
			return {
				IMAGE_URL: appConfig.IMAGE_URL,
				imageUrl: '~@static/shop/',
				typeIndex: 0,
				orderIndex: 0,
				orderType: ['全部', '议价', '竞价','一口价' ],
		
			
				radioArr: [
					{name: '全部', value: ''},
					{name: '便利店', value: '便利店'},
					{name: '大型超市', value: '大型超市'},
					{name: '甜筒专卖店', value: '甜筒专卖店'},
				],
				priceBetween: [
					{name: '14元以下', des: '60%的选择'},
					{name: '14-34元', des: '30%的选择'},
					{name: '34-79元以下', des: '9%的选择'},
					{name: '79元以上', des: '1%的选择'},
				],
				selectShow: false,
				showFilter: false,
				params: {
					page:1,
					limit:10,
					status:0,
					ptype:1,
					
				},
				
				
				
			}
		},
		onLoad() {
			
		},
		methods: {
			goPage(url) {
			    uni.navigateTo({ url });
			},
			changeprderType(index){
				this.orderIndex = index
				if(this.orderIndex ==1){
					this.getorderType()
				}
			},
			getorderType(){
				getorderliststatus().then(res=>{
					this.typeList = res.data
					this.typeIndex = 0
					this.changetypelist(this.typeList[0],0)
				})
			},
			changetypelist(item,index){
				this.params.page =1
				this.params.status =item.id
				this.typeIndex = index
				this.getgoodslist()
			},
			getgoodslist(){
				getorderlist(this.params).then(res=>{
					console.log(res);
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
@import url("/common/public.scss");
	.main {
		background: linear-gradient( 180deg, #B5CFFF 0%, rgba(246,249,255,0.2) 30%, #F6F9FF 100%);
		height: 100%;
	}
	
	.margin32 {
		margin: 0 32rpx;
	}

	
	.scroll-x {
		padding: 28rpx 0;
		box-sizing: border-box;
		border-radius: 20rpx;
		white-space: nowrap;
		width: auto;
		.type {
			padding: 0 20rpx;
			box-sizing: border-box;
			height: 48rpx;
			background: #EEEEEE;
			border-radius: 60rpx;
			color: $uni-text-color-grey;
			margin-right: 28rpx;
			
			&:nth-child(1) {
				margin-left: 32rpx;
			}
		}
		
		.active {
			color: $uni-text-color;
			background: $uni-color-primary;
			font-weight: 500;
		}
	
	}
	
	.swiper-box {
		padding: 28rpx;
		box-sizing: border-box;
		margin-bottom: 28rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0,0,0,0.1);
		border-radius: 24rpx 24rpx 24rpx 24rpx;
		
		
	
		.time-color{
			color:$uni-text-color-grey;
			margin-bottom: 24rpx;
			margin-left: 12rpx;
		}
		.swiper-title{
			color:$uni-text-color;
		}
		.swiper-state{
			.price {
				color: #FF4444;
				align-items: baseline;
				margin-top: 16rpx;
			
				.flex {
					align-items: baseline;
				}
			
				.time {
					color: #999999;
				}
			}
			
			
		}
		.swiper-des{
			color:$uni-text-color-grey1;
			margin-bottom: 20rpx;
		}
		.title-icon {
			width: 32rpx;
			height: 24rpx;
			margin-right: 10rpx;
		}
	
	
		.item-icon{
			width: 30rpx;
			height: 30rpx;
			margin-bottom: 20rpx;
			margin-right: 6rpx;
			image{
				width: 30rpx;
				height: 30rpx;
				vertical-align: top;
			}
		}
		.order-btn{
			width: 100%;
			height: 76rpx;
			background: linear-gradient( 90deg, #0785CF 0%, #25A4EF 100%);
			box-shadow: 0px 4rpx 20rpx 0rpx rgba(7,133,207,0.1);
			border-radius: 60rpx 60rpx 60rpx 60rpx;
			color:$uni-text-color-inverse;
			text-align: center;
			line-height: 76rpx;
			margin-top: 12rpx;
		}
	}
	
	.price {
		color: $uni-text-color-red;
		align-items: baseline;
	}
	
	.select-box {
		position: relative;
		background: $uni-bg-color;
		box-sizing: border-box;
		
		.filter-btn {
			color: $uni-color-primary;
			
			.icon-loudou {
				margin-right: 4rpx;
			}
		}
		
		.select-modal {
			width: 100vw;
			position: absolute;
			z-index: 10;
			background: $uni-bg-color;
			border-radius: 0rpx 0rpx 28rpx 28rpx;
			left: -32rpx;
			top: 100%;
			margin-top: 8rpx;
			padding: 28rpx 32rpx;
			box-sizing: border-box;
			
			.select-modal-item {
				margin-top: 40rpx;
				color: $uni-text-color-grey1;
				
				&:nth-child(1) {
					margin: 0;
				}
			}
			
			.radio {
				width: 26rpx;
				height: 26rpx;
				border-radius: 50%;
				border: 1rpx solid $uni-color-primary;
			}
			
			.active {
				color: $uni-text-color;
				
				.radio {
					background: $uni-color-primary;
					color: $uni-text-color-inverse;
				}
			}
		}
	}
	
	.order-type {
		padding: 20rpx 32rpx;
		background: transparent;
		
		.item {
			color: $uni-text-color-grey1;
			height: 42rpx;
			position: relative;
		}
		
		.active {
			font-weight: 500;
			font-size: 32rpx;
			color: $uni-text-color;
			
			&:before {
				content: '';
				width: 32rpx;
				height: 6rpx;
				background: #0785CF;
				border-radius: 20rpx;
				position: absolute;
				bottom: -20rpx;
				left: 50%;
				transform: translate(-50%, 0);
			}
		}
	}
	
	.white-box {
		background: $uni-bg-color;
		box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0,0,0,0.1);
		border-radius: 20rpx;
		padding: 28rpx;
		box-sizing: border-box;
		margin-bottom: 28rpx;
		
		.store-title {
			padding-bottom: 28rpx;
			border-bottom: 1rpx solid #DDDDDD;
			margin-bottom: 28rpx;
			color: $uni-text-color-grey1;
		}
		
		.order-status {
			color: #DF9824;
		}
		
		image {
			width: 160rpx;
			height: 160rpx;
			border-radius: 20rpx;
			margin-right: 18rpx;
			flex-shrink: 0;
		}
		
		.store-info {
			height: 160rpx;
			flex: 1;
			width: 0;
			align-items: flex-start;
			
			.sale-num {
				color: $uni-text-color-grey;
				margin-top: 12rpx;
			}
			
			.icon-comment {
				margin-left: 26rpx;
			}
		}
		
		.order-btn {
			margin-top: 28rpx;
			color: $uni-text-color-inverse;
			justify-content: flex-end;
			
			.btn-1 {
				width: 160rpx;
				height: 56rpx;
				background: #DF9824;
				border-radius: 100rpx;
				margin-right: 28rpx;
			}
			
			.btn-2 {
				width: 160rpx;
				height: 56rpx;
				background: #0785CF;
				border-radius: 100rpx;
			}
		}
	}
	
	.modal-title {
		margin: 40rpx 0;
		
		.icon-close {
			position: absolute;
			right: 32rpx;
			top: 50rpx;
		}
	}
	
	.modal-content {
		
		.checkbox-box {
			flex-wrap: wrap;
			
			.checkbox {
				width: calc((100% - 36rpx) / 3);
				height: 86rpx;
				background: #F5F5F5;
				border-radius: 100rpx;
				margin-top: 40rpx;
				margin-right: 18rpx;
				
				&:nth-child(3n) {
					margin-right: 0;
				}
				
				.font24 {
					color: $uni-text-color-grey;
					margin-top: 4rpx;
				}
			}
			
			.active {
				background: #FFEFD5;
			}
		}
		
		.input-group {
			height: 86rpx;
			background: #F5F5F5;
			border-radius: 60rpx;
			margin: 40rpx 0 54rpx;
			
			.line {
				width: 40rpx;
				height: 1rpx;
				background: $uni-text-color-grey;
			}
			
			input {
				text-align: center;
			}
		}
	}
	
	.modal-footer {
		color: $uni-text-color-inverse;
		margin: 40rpx 0 calc(env(safe-area-inset-bottom) + 20rpx) 0;
		
		.clear-btn {
			width: 260rpx;
			height: 80rpx;
			background: #DF9824;
			box-shadow: 0rpx 6rpx 12rpx 0rpx rgba(223,152,36,0.3);
			border-radius: 100rpx;
		}
		
		.submit-btn {
			width: 260rpx;
			height: 80rpx;
			background: #0785CF;
			box-shadow: 0rpx 6rpx 12rpx 0rpx rgba(7,133,207,0.3);
			border-radius: 100rpx 100rpx 100rpx 100rpx;
			margin-left: 60rpx;
		}
	}

	.content-top{
	
		/* #ifdef H5 */
	//	height: calc(100vh - 50px);
		/* #endif */
		/* #ifdef APP-PLUS */
	//	height: 100vh;
		/* #endif */
		height:calc(100vh - var(--status-bar-height) - 88rpx - 84rpx - 104rpx - 40rpx );  
	
	}
	.order-price {
	    font-size: 28rpx;
	    color: #FF4444;
	    font-weight: 600;
	
	    .big {
	        font-size: 32rpx;
	    }
	}
	.time-icon{
		width: 28rpx;
		height: 28rpx;
		margin-right: 6rpx;
		
		image{
			width: 28rpx;
			height: 28rpx;
			vertical-align: top;
		}
	}
	.address-style{
		width: 10rpx;
		height: 10rpx;
		border-radius: 10rpx;
		border: 1rpx solid #DF9824;
		margin-right: 18rpx;
	}
	.divider-style{
		width: 0rpx;
		height: 28rpx;
		border: 1px solid #FFE7C0;
		margin-left: 4rpx;
	}
	.icon-clock {
		font-size: 24rpx;
		color: #DF9824;
		margin-right: 4rpx;
	}
</style>
